# coding:utf-8
from rest_framework.views import exception_handler
from rest_framework.response import Response


def my_exception_handler(exe, context):
    response = exception_handler(exe, context)
    if not response:
        # 此处对异常信息进行日志保存
        response = Response({'detail': '服务器异常,%s' % exe},status=500)
    return response